package com.ayf.payment.game.api.mapper;

import com.ayf.payment.game.api.dto.SettleRateInfoDTO;
import com.ayf.payment.game.api.dto.TemplateChannelDTO;
import com.ayf.payment.game.api.dto.criteria.MerchantSettleRateCustomCriteria;
import com.ayf.payment.game.api.entity.MerchantSettleRateCustom;
import com.ayf.payment.game.api.entity.platform.PaymentProduct;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface MerchantSettleRateCustomMapper extends Mapper<MerchantSettleRateCustom> {

    /**
     * 批量添加费率配置信息
     *
     * @param list
     * @return
     */
    int insertBatch(@Param("list") List<MerchantSettleRateCustom> list);

    /**
     * 更改支付产品状态
     *
     * @param merchantSettleRateCustom
     * @return
     */
    int updateStatus(@Param("custom") MerchantSettleRateCustom merchantSettleRateCustom);

    /**
     * 更改商户费率id
     *
     * @param ids
     * @param rateId
     * @return
     */
    int updateMerchantRateId(@Param("id") Integer id, @Param("ids") List<Integer> ids, @Param("rateId") Integer rateId);

    /**
     * 查询出普通商户结算信息
     *
     * @param merchantId
     * @return
     */
    List<SettleRateInfoDTO> selectRateInfo(Integer merchantId);

    /**
     * 查询出下级商户结算信息
     *
     * @param merchantId
     * @return
     */
    List<SettleRateInfoDTO> selectLowerRateInfo(Integer merchantId);

    /**
     * 查询出商户开启的充值产品
     *
     * @param custom
     * @return
     */
    List<PaymentProduct> selectPaymentProduct(@Param("custom") MerchantSettleRateCustomCriteria custom);

    /**
     * 查询该商户的支付产品信息
     *
     * @param merchantId
     * @return
     */
    List<TemplateChannelDTO> selectChannelGive(@Param("merchantId") Integer merchantId, @Param("templateId") String templateId);
}